package github.sf.mod.calculate.entity;

public interface AstVisitor {
    Object visit(AstNode astNode, Object additional);

    default Object visitBinary(Binary astNode, Object additional) {
        return null;
    }

    default Object visitNumberLiteral(NumberLiteral astNode, Object additional) {
        return null;
    }

    void dump(int index);

    default String addPrefix(int i) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int j = 0; j < i; j++) {
            stringBuilder.append("+");
        }
        return stringBuilder.toString();
    }
}
